﻿@using BonjourQuotation.UI.Models.PartialModel
@model QuotationGuideGridViewModel
@{
   
}
<div id="VendorContractGuide" style="display:none;">
</div>
@using (Ajax.BeginForm("UpdateQuotationGuide", "Quotation", new AjaxOptions() { HttpMethod = "Post", OnComplete = "QuotaGuideTabAjaxComplete()", UpdateTargetId = "tabGuide", InsertionMode = InsertionMode.Replace }, new { enctype = "multipart/form-data", id = "QuotaGuideGridForm" }))
{

   <table class="table table-bordered table-hover">
    <th>#</th>
    <th>Day</th>
    <th>Date</th>
    <th>Service</th>
    <th>Guide</th>
    <th>M</th>
    <th>Rate</th>
    @*<th>#</th>*@
    <th># Days</th>
    <th>Cost</th>
    <th>Curr</th>
    @if (Model.QuotaGuideRemoveBtnView && !(Model.QuotaGuideConfirmed))
    {
        <th>del</th>
    }
    <tbody>
        @if(Model.Rows.Count>0)
        { 
            @Html.HiddenFor(model=>model.Rows[0].QuotaID)
        }
        @for (int ind = 0; ind < Model.Rows.Count; ind++)
{
    Model.SelServiceID = Model.Rows[ind].SelectedServiceID;
    <tr class="@(@Model.Rows[ind].CurrencyGuide == "CA" ? "trCurrencyCad" : "") @(@ind % 2 == 0 ? "trRowBackground1" : "")">
        <td class="tdBorderBlack">@Html.LabelForModel(Model.Rows[ind].LineNo)</td>@Html.HiddenFor(model => model.Rows[ind].LineNo)
        <td class="tdBorderBlack">
            @Html.TextBoxFor(model => Model.Rows[ind].Day, new { @class = "QuotaOnlyDigits QuotaDay QuotaTextBx table_inputs_50 table_inputs_WithoutBox GuideDetTab DayCls" })
        </td>
        
        @if (Model.Rows[ind].LineDate.Contains("Fri") || Model.Rows[ind].LineDate.Contains("Sat"))
        {
            <td class="tdBorderBlack">
                @Html.LabelForModel(Model.Rows[ind].LineDate, new { @class = "table_inputs_Date QuotaDatesFriSat" })
            </td>
        }
        else
        {
            <td class="tdBorderBlack">
                @Html.LabelForModel(Model.Rows[ind].LineDate, new { @class = "table_inputs_Date" })
            </td>
        }
        <td class="tdBorderBlack">
            @Html.DropDownListFor(model => model.SelServiceID, new SelectList(Model.Service, "Value", "Text"), new { @class = "table_inputs_160 GuideServiceDrop GuideDetTab", @style = "height:23px;" })
            @Html.DropDownListFor(model => Model.Rows[ind].SelectedServiceID, new SelectList(Model.Service, "Value", "Text"), new { @class = "RoomGridDropHide" })
        </td>
        @if (Model.Rows[ind].GuideMFlag == false)
        {
            <td class="tdBorderBlack">
                @Html.TextBoxFor(model => Model.Rows[ind].DescriptionGuide, new { @class = "table_inputs_550 table_inputs_WithoutBox GuideDetTab QuotaTxtComplete" })
                @Html.HiddenFor(model => Model.Rows[ind].GuideID, new { @class = "GuideID" })
            </td>
        }
        else
        {
            <td class="tdBorderBlack">
                @Html.TextBoxFor(model => Model.Rows[ind].DescriptionGuide, new { @class = "table_inputs_550 table_inputs_WithoutBox GuideDetTab" })
                @Html.HiddenFor(model => Model.Rows[ind].GuideID, new { @class = "GuideID" })
            </td>
        }
        <td class="tdBorderBlack">
            @Html.CheckBoxFor(model => Model.Rows[ind].GuideMFlag, new { @class = "QuotaRemTxtComplete GuideDetTab GuideMFlag", @tabindex = "-1" })
        </td>
        <td class="tdBorderBlack">
            @Html.TextBoxFor(model => Model.Rows[ind].Rate, new { @class = "QuotaOnlyDecimalDigits QuotaTextBx table_inputs_Decimal table_inputs_WithoutBox GuideRate GuideDetTab QuotaMoneyTxb" })
        </td>
        @*<td>
                @Html.TextBoxFor(model => Model.Rows[ind].Qty, new { @class = "table_inputs_Decimal GuideDetTab" })
            </td>*@
        <td class="tdBorderBlack">
            @Html.TextBoxFor(model => Model.Rows[ind].DayQty, new { @class = "QuotaOnlyDigits table_inputs_50 table_inputs_WithoutBox GuideDetTab DayCls QuotaTextBx" })
        </td>
        <td class="tdBorderBlack">
            @Html.LabelForModel(Model.Rows[ind].Cost, new { @class = "table_inputs_60 Label_QuotaGrd" })
        </td>
        <td class="tdBorderBlack">
            @if (Model.Rows[ind].CurrencyGuide == "CA")
            {
                @Html.TextBoxFor(model => Model.Rows[ind].CurrencyGuide, new { @class = "QuotaTextBx CurrencyGuide table_inputs_50 table_inputs_WithoutBox GuideDetTab QuotationCurrCAD" })
            }
            else
            {
                @Html.TextBoxFor(model => Model.Rows[ind].CurrencyGuide, new { @class = "QuotaTextBx CurrencyGuide table_inputs_50 table_inputs_WithoutBox GuideDetTab" })
            }
        </td>
        @if (Model.QuotaGuideRemoveBtnView && !(Model.QuotaGuideConfirmed))
        { 
            <td><button class="btndel" style="padding:0px;" type="button" onclick="RemoveGuide('@Model.Rows[ind].QGuideID','@Model.Rows[ind].LineNo')"></button></td>
        }
    </tr>
}
    </tbody>
</table>
    if (Model.QuotaGuideInsertBtnView && !(Model.QuotaGuideConfirmed))
    {
        <input type="number" class="QuotaTabInsertTxb" id="GuideInsertLine" min="1" value="1" />
        <button class="btn14" type="button" onclick="InsertLineGuideGrid()">Insert</button>
    }
    <div class="pull-right QuotaTabUpdateDivBtn">
        @if (Model.QuotaGuideNewLineBtnView && !(Model.QuotaGuideConfirmed))
        { 
            <button class="btn14" type="button" onclick="GuideNewLine()">New Line</button>
        }
        @if (Model.QuotaGuideUpdateBtnView && !(Model.QuotaGuideConfirmed))
        { 
            <button class="btn14" id="GuideTabUpdate" type="button">Validate</button>
        }
    </div>
<table class="table table-bordered table-hover">
    <th>@Html.LabelFor(model=>model.RoomLgBk)</th>
    <th>@Html.LabelFor(model => model.LunchDinner)</th>
    <th>@Html.LabelFor(model => model.Entrance)</th>
    <th>@Html.LabelFor(model => model.SallaryMisc)</th>
    
    <tbody>
           <tr>
                <td>@Html.LabelForModel(Model.RoomLgBk)</td>
                <td>
                    @Html.LabelForModel(Model.LunchDinner)               
                 </td>
                <td>
                    @Html.LabelForModel(Model.Entrance) 
                </td>
                <td>
                    @Html.LabelForModel(Model.SallaryMisc)
                </td>
                
            </tr>
    </tbody>
</table>

<div class="row form-row">

    <div class=" col-lg-2 withoutPadding" style="width: 13% !important; margin-left: 30px;">
        <div class="input-group">
            <span class="input-group-addon SumControlsLabelFSize" style="width: 30px !important;">@Html.LabelFor(model => model.Count)</span>
            @Html.LabelForModel(Model.Count, new { @class = "form-control SumControlsFSize" })
        </div>
    </div>
    <div class=" col-lg-2" style="width: 16% !important; ">
        <div class="input-group">
            <span class="input-group-addon SumControlsLabelFSize" style="width: 30px !important;">@Html.LabelFor(model => model.TotalGuide)</span>
            @Html.LabelForModel(Model.TotalGuide, new { @class = "form-control SumControlsFSize" })
        </div>
    </div>
    <div class=" col-lg-2" style="width: 16% !important;">
        <div class="input-group">
            <span class="input-group-addon SumControlsLabelFSize" style="width: 30px !important;">@Html.LabelFor(model => model.TotalExpenses)</span>
            @Html.LabelForModel(Model.TotalExpenses, new { @class = "form-control SumControlsFSize" })
        </div>
    </div>
   
</div>
}

        
  


